package com.quanyan.user.service.impl;

import com.quanyan.common.constants.Constants;
import com.quanyan.user.mapper.TbChannelLayoutMapper;
import com.quanyan.user.model.db.TbChannelLayout;
import com.quanyan.user.model.db.TbChannelLayoutExample;
import com.quanyan.user.service.LayoutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/3/2.
 */
@Service
public class LayoutServiceImpl implements LayoutService{

    @Autowired
    private TbChannelLayoutMapper tbChannelLayoutMapper;


    public List<TbChannelLayout>  queryFindLayoutByModule(byte channelId){
        TbChannelLayoutExample tbChannelLayoutExample = new TbChannelLayoutExample();
        TbChannelLayoutExample.Criteria criteria = tbChannelLayoutExample.createCriteria();
        criteria.andModuleEqualTo(channelId);
        criteria.andIsDeleteEqualTo(false);
        criteria.andStatusEqualTo(Constants.IS_DELETE_FALSE);
        List<TbChannelLayout> lst =  tbChannelLayoutMapper.selectByExample(tbChannelLayoutExample);
        return lst;

    }

}
